package homewoek1月4号.demo3.d6;

import java.util.Objects;

public class Emp {
    private String ename;
    private String eid;
    private String did;
    private String esalary;

    public Emp(String ename, String eid, String did) {
        this.ename = ename;
        this.eid = eid;
        this.did = did;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Emp emp = (Emp) o;
        return Objects.equals(eid, emp.eid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(eid);
    }

    @Override
    public String toString() {
        return "Emp{" +
                "ename='" + ename + '\'' +
                ", eid='" + eid + '\'' +
                ", did='" + did + '\'' +
                ", esalary='" + esalary + '\'' +
                '}';
    }

    public Emp() {
    }

    public Emp(String ename, String eid, String did, String esalary) {
        this.ename = ename;
        this.eid = eid;
        this.did = did;
        this.esalary = esalary;
    }

    public String getEname() {
        return ename;
    }

    public void setEname(String ename) {
        this.ename = ename;
    }

    public String getEid() {
        return eid;
    }

    public void setEid(String eid) {
        this.eid = eid;
    }

    public String getDid() {
        return did;
    }

    public void setDid(String did) {
        this.did = did;
    }

    public String getEsalary() {
        return esalary;
    }

    public void setEsalary(String esalary) {
        this.esalary = esalary;
    }
}
